from datetime import datetime
from pydantic import BaseModel
from typing import List, Optional

class LogBase(BaseModel):
    action: str
    details: str

class LogCreate(LogBase):
    pass

class Log(LogBase):
    id: int
    created_at: datetime

    class Config:
        from_attributes = True

class PaginatedLogResponse(BaseModel):
    total: int  # 总记录数
    items: List[Log]  # 当前页的数据
    skip: int  # 跳过的记录数
    limit: int  # 每页记录数